-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract Profile - Contrast enhancement -- Selective Editing Cam16 and JzCzHz - improvments #7111
Conversation
@Lawrence37 For example, during the "Challenge" in spring 2024, which focused on this Cam16 module, no one used these features and no one saw that there were bugs,, and yet 6 users who cannot be described as "amateurs" tested Cam16 and SDA for more than 1 month... Cordially. Jacques |
As agreed, and even if I think it's a mistake, I changed "procparams.cc" taking into account "ppversion < 352" Three groups of variables are concerned:
I tested with the 2 pp3 files you attached "Cam16.pp3" and "Jzazbz.pp3". It seems to work. But as these manipulations are not my strong point, you can check and modify if necessary. I also changed the ModeQJ toolip which no longer has any reason to exist in its old form. Cordially Jacques |
Thanks, I confirm the pp3s result in the same output between 5.11 and this PR. I assure you that this is not a mistake. Here's why. There are two possible scenarios when someone opens an old edit. First, they are fine with what the old algorithm did. In this scenario, there is no point in forcing them to use a different algorithm because the results are already satisfactory. Second, they want to tweak the edit or start fresh. In this scenario, the processing parameters have changed. Backward compatibility is no longer relevant. You are free to prevent them from going back to the old algorithms. There is no disagreement between us because my only concern is the backward compatibility. So really, only the first scenario restricts what you can do, and I doubt anyone can come up with a good argument why a user isn't actually satisfied with an edit whey they think they are satisfied. |
OK, thank you, this confirms that I was not mistaken... I am waiting, today or tomorrow, for comments on Laels and Tooltips from Wayne Then I think you will agree to "merge" with dev? (I hope) Thank you Jacques |
@Desmis Jacques, In the “Cam16” CAM model the tooltip TP_LOCALLAB_QJMODE_TOOLTIP Vous permet de choisir, pour les opérateurs tone-mapping utilisant les données Brightness : Q pour Cam16 - et J pour Jz, entre la version courante (recommandée) 5.12 et les versions antérieures 5.11.
|
@waynesutton50 It is obvious that this "addition" of 5.11 compatibility with different algorithms is not easy to explain in a tooltip. For Cam16, for Sigmoid this only concerns the Sigmoid Q part "in the Ciecam loop" -Cam16 Image Adjustments
The 2 Sigmoid algorithms are different The new part brought since 5.12 in SDA remains the same (5.11 or 5.12) with the menu "Tone mapping operators *" with choices : none, Ev based, Gamma based, Slope based, RGB channel slope, Sigmoid Based . Sigmoid base has been added with 5.12 but is not affected by the tooltip For Cam16 and Log encoding in SDA (Source Data Adjustments) version 5.11 is seen with one more choice: For JzCzHz the difference is only Sigmoid Jz in "Scene conditions" - the algorithms and settings are different I have taken note of your remarks and thank you for them and will continue tomorrow morning. Jacques |
@Desmis There is one comment I made about using a unique pointer. Let me know when I can push the code to address the comment. |
@waynesutton50 ====
Les autres variables et fonctions dans Cam16, situées dans Source Data Adjustments : Log Encoding ou Tone mapping operators utilisent toutes les données RGB. =====
Log encoding Jz is not concerned by this change, only Sigmoid Jz
I don't think so. Cam16 is a real CAM (Color Appearance Model), which JzCzHz is not. I made the changes you suggested and harmonized in the "deprecated" Labels by putting it in parentheses. (deprecated) In French Ce slider ménage l'avenir, il suppose un moniteur HDR (ou très performant). Malheureusement actuellement, les profils de sortie vers les moniteurs - au moins ceux présents dans RT - sont en Lab 8 bits, donc incapables d'utiliser pleinement ces données. On peut dire la même chose en grande partie pour le module JzCzHz Thank you Jacques |
@Desmis @Lawrence37 TP_LOCALLAB_QJMODE_TOOLTIP;The tone-mapping operators that use brightness data (Q for CAM 16 and J for Jz) have been modified in RawTherapee version 5.12. This allows you to select either the current or the deprecated version. TP_LOCALLAB_SIGMOIDNORMCIEDISP_TOOLTIP;Allows you to adapt the white point to the peak luminance of the display device. Its position in the processing pipeline is not optimal so use with caution. |
Thank you, I will update this afternoon :) Jacques |
No problem, you can push your change about using a unique pointer. :) Jacques |
@Desmis I added the commit. |
@Lawrence37 I also tried to better take into account the recommendations of Rawpedia (allways down) for respecting uppercase (U) and lowercase (L) in Frames, checkboxes, etc. I also tried in these modifications to update the tooltips with these same modifications. But nothing is perfect. I don't think I have to make any more changes to this PR My computer returned from repair after a power surge (motherboad burned) is working very poorly, I returned it to the manufacturer, and so I am still with my (very) old machine Jacques |
I think, after this big review on Labels, tooltips, convention, etc. that I finished |
OK thank you. I will merge soon :) |
Contrast Enhancement
Purpose
This module complements the Tonal Response Curve (TRC) in the Abstract Profile (Color tab) and allows the user to carry out tonal contrast adjustments.
Is tonal contrast a difficult concept?
Traditionally, any graphics software can be used to retouch contrast. Empirically, this can be translated as modifying the difference in luminosity between the light and dark parts of an image.
There are various algorithms some of which may or may not take into account the following:
Contrast acts on the luminance channel, whether in RGB (or its HSV derivatives, etc.) or Lab mode. and can be modified using various tools of varying complexity, linear or non-linear. For example by using functions such as log encoding, Laplacians, wavelets, guided filters, tone curves, sigmoid curves etc.
The special case of wavelets:
Wavelets are a little-known mathematical tool that is not widely used as such in image-processing software but can be the basis for other tools. Rawtherapee is, to my knowledge, the only one to have a coherent and grouped set of tools using wavelets. Unfortunately, the whole package may seem complex and off-putting.
Extensive information about the principles of wavelets and the various tools can be found in RawPedia so I won’t repeat the information here. To summarise:
They are then sorted according to whether the values are positive or negative for the horizontal, vertical and diagonal directions. The decomposition method used allows the user to choose the number of Daubechies vanishing moments, which affect the quality and finesse of the decomposition.
The following tools are available in Rawtherapee:
Contrast by level -this tool can be found in various forms in:
-The Selective Editing tab
-Local Contrast & Wavelets > Pyramid 2 > Contrast by level
-Contrast by Detail Levels
-The Advanced tab (Advanced > Wavelet Levels > Contrast)
-The Detail tab (Contrast by Detail Levels)
It allows you to modify the contrast values of each group of pixels on a per-level basis in each of the 3 directions and for both the positive and negative values. However visible artefacts can appear fairly quickly (noise, blurring, distortion, sculpting effects, etc.) even when taking measures such as progressively reducing the strength of the action for high levels of detail. Additional tools can be used to reduce - but not eliminate - these artefacts (“Attenuation response”, “Selective luminance range”, etc.).
Edge sharpness (Advanced > Wavelet Levels and in Selective Editing > Local Contrast & Wavelets) is used both to reinforce edges, similar to the methods used in sharpening tools, and to soften backgrounds (similar to tools such as darktable's “diffuse or sharpen”). Refer to RawPedia for details.
Other tools such as Clarity and “Blur levels” (both in Advanced > Wavelet Levels and in Selective Editing > Local Contrast & Wavelets) etc., allow effects that virtually only wavelets can provide.
Local contrast: faced with the problems inherent in contrast by level, I decided a few years ago (around 2013) to take a different approach to wavelet contrast. For each level and direction, I evaluate the shape of the signal (average, standard deviation, maximum for positive and negative values). The whole thing is modelled in such a way that the user is faced with a single curve for modifying the contrast, whatever the level. This curve uses the characteristics of the signal to position the mean value at the centre of the graph, take into account the variations on either side of the mean and position the maximum at the far right of the graph. It weakens the action for large values close to the maximum. The system's behaviour avoids the majority of artefact problems, and acts in a fairly similar way across the different levels of detail. I've called this approach 'Local contrast', but this doesn't really convey what it does. This tool is present in Rawtherapee in the Wavelet Levels > Final Touchup module, in several other modules such as Wavelet Levels > “Edge sharpness” and in Selective Editing > Local Contrast & Wavelets. It can also be found in ART.
Curiously, until now this tool has not been available separately in the tools available in full-image mode.
Variable contrast
However, despite this improvement, the system cannot, at the same time, and with the same quality as seen from the user's point of view, process the levels containing small details (from 0 to around 6) and those containing large details (from around 5 to 9) in the same way.This is why I propose to combine the action of the two systems (“Contrast by levels” and Local Contrast) into a single system.
In this new system, which I have called Contrast Enhancement, per-level contrast is contained in a series of contrast-profile presets, which provide the information needed to adjust the amount of local contrast in each of the levels.
Each preset contains a selection of decomposition levels.
In each of these levels, the contrast values are divided up into ten discrete samples ranging from the lowest to the highest values. The low-contrast-value samples and the high-contrast-value samples (which are often synonymous with artifacts) are then attenuated. The nature and intensity of this attenuation depends on the preset and whether or not "Highlight attenuation" has been activated.
Each preset also contains information used to weight the overall level data to either attenuate the data for the first level (to reduce noise) or to progressively attenuate it for the higher levels.
-the resulting data from each decomposition level is then sent to the curve, which should be preferably “bell shaped” to concentrate the action on the useful levels and attenuate the action at the extremities.
The Contrast Enhancement module has the following characteristics:
What does this tool consist of?
It consists of three parts:
A “Contrast profile” slider that lets you select several contrast-profile presets as described above.These presets offer a selection of possible degrees of contrast.
These presets are classified :
At the same time, these presets progressively weaken the action of the “Variable contrast” curve as you move the “Contrast profile” slider to the right.
The “Variable contrast” curve , which is the heart of the system, is used to modify the existing contrast values, based on the size of the pixel groups, their contrast and possible artefacts. The information contained in the presets determines the behaviour of the curve. However, whatever the preset and the level of detail: a) the mid-point of the x-axis corresponds to the most important contrast value for the action; b) the maximum point, to the right of x-axis, corresponds to the maximum contrast found. It is recommended to reduce the variable contrast beyond the mean value.
A Refinement expander, which can be used to modify: a) the distribution of the action between the low, medium and high values of the “Variable contrast” curve, in particular by widening or narrowing the effects of the width of the curve; b) adjust the residual image after decomposition to compensate for excessive effects linked to the action of the curve and the presets.
Moving the Color Management module
The Color Management module (which includes the Abstract Profile) has been moved up in the Color tab and positioned just after the White Balance module. This is to improve it’s visibility and to take into account the fact that it is likely to be used more frequently.
Selective Editing Cam16
In Source Data Adjustments > Highlight attenuation & RGB channels, The RGB Channel Slope module has been improved to better use the tone mapping algorithm.